From 738530292fb63f3f4a3482aa7cf05c4c339af186 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 1 Dec 2009 14:19:28 +0000 Subject: [PATCH] x86: Correctly allocate module-relocation area and bzimage headroom. Without this patch, loading a bzimage dom0 kernel while also requesting a dynamically-allocated crashkernel area is broken. Signed-off-by: Keir Fraser --- xen/arch/x86/setup.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 98249807bc..d1745ba94d 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -762,11 +762,9 @@ void __init __start_xen(unsigned long mbi_p) ((e-s) >= (modules_length+modules_headroom)) ) { initial_images_end = e; - e = (e - modules_length) & PAGE_MASK; - initial_images_start = e; - e -= modules_headroom; - initial_images_base = e; - e += modules_length + modules_headroom; + initial_images_start = initial_images_end - modules_length; + initial_images_base = initial_images_start - modules_headroom; + initial_images_base &= PAGE_MASK; for ( j = mbi->mods_count-1; j >= 0; j-- ) { e -= mod[j].mod_end - mod[j].mod_start; @@ -774,6 +772,7 @@ void __init __start_xen(unsigned long mbi_p) mod[j].mod_end += e - mod[j].mod_start; mod[j].mod_start = e; } + e = initial_images_base; } if ( !kexec_crash_area.start && (s < e) && -- 2.30.2